<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title></title>
    <style></style>
  </head>
  <body>
    <script>
      function getUrlParam() {
        var url = location.href;
        if (url.indexOf("?") !== -1) {
          var arr = url.split("?");
          arr.shift();
          var str = arr.join("?");
          arr = str.split("&");
          var obj = {};
          for (var i = 0, ii; (ii = arr[i++]); ) {
            var mid = ii.split("=");
            var key = mid.shift();
            obj[key] = mid.join("=");
          }
          return obj;
        }
        return null;
      }
      let { token, tenantId } = getUrlParam() || {};
      if (token && tenantId) {
        //static/transfer.html?token={token}&tenantId={tenantId}
        localStorage.setItem("TOKEN__", token);
        localStorage.setItem("TENANT_", window.btoa(tenantId));
        location.href = "../#/aiot";
      } else {
        location.href = "../#/login";
      }
    </script>
  </body>
</html>
